package org.jackysoft.service;

import java.util.Collection;

import org.jackysoft.data.IDataProvider;
import org.jackysoft.entity.AcegiRole;
import org.jackysoft.entity.TreeNode;
import org.springframework.dao.DataAccessException;

public interface TreeNodeService extends IDataProvider<String,TreeNode> {

	/**
	 * 取得简单的id,text这样用来显示根目录的节点列表
	 */
	Collection<TreeNode> getsSimpled() throws DataAccessException;

	
	Collection<TreeNode> getsByParentAndCurrentUser(String parentId) throws DataAccessException;
	
	Collection<TreeNode> getsByParent(String parentId) throws DataAccessException;

	Collection<TreeNode> getsByParentAndSecurole(String parentId,String acegi) throws DataAccessException;

	Collection<TreeNode> getsBySecurole(AcegiRole secRole) throws DataAccessException;
	
	/**
	 * 主要用来获得当前用户的权限节点
	 * @param parentId 树节点
	 * 
	 * 
	 * */
	Collection<TreeNode> getsByCurrentUser(String parentId)throws DataAccessException;
	Collection<TreeNode> getsByCurrentUser()throws DataAccessException;

	/**
	 * dwr ajax 使用方法,用来动态获取树节点的字节点
	 * 
	 * @param parentId
	 *            父节点ID
	 * @param htpSession
	 *            上下文session dwr用
	 * @author Administrator
	 */
	Collection<TreeNode> getsCheckboxedByParent(String parentId) throws DataAccessException;

	/**
	 * 批量更新树的排序号
	 */
	void batchUpdateSorted(Collection<TreeNode> trees) throws DataAccessException;

}
